import react from '@vitejs/plugin-react'
import path from "node:path";
import tailwindcss from "tailwindcss"
import {defineConfig} from 'vite'


// https://vitejs.dev/config/
export default defineConfig({
    define: {
        'process.env': {}, // 或根据需要设置特定的环境变量
    },
    css: {
        postcss: {
            plugins: [
// @ts-ignore
                tailwindcss,
            ]
        }
    },
    resolve: {
        alias: {
            "@": path.resolve(__dirname, "src"),
        }
    },

    server: {
        proxy: {
            '/api': {
                target: 'http://localhost:8080',
                changeOrigin: true,
                // rewrite: (path) => path.replace(/^\/api/, ''),
            },
        }
    },
    plugins: [react()],
})
